/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/12
* File: OGLGraphicsBuffer.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef OGLGraphicsBuffer_h__
#define OGLGraphicsBuffer_h__

#include "../../Core/Core.h"
#include "../../Core/Declare.h"
#include "../GraphicsBuffer.h"

class OGLGraphicsBuffer : public GraphicsBuffer
{
public:
	OGLGraphicsBuffer(BufferUsage usage, u32 access_hint, GLenum target, void* init_data = NULL, u32 size = 0);
	~OGLGraphicsBuffer();

	void resize(u32 size_in_byte);
	void active();
	void copyToBuffer(const GraphicsBuffer& other);

protected:
	void* _map(BufferAccess ba);
	void _unmap();

protected:
	GLuint			_vb;
	GLenum			_target;
};

#endif    /* OGLGraphicsBuffer_h__ */